<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>菜单管理--${fns:getConfig('productName')}</title>
<%@include file="/common/treetable.jsp" %>
<script type="text/javascript">
$(document).ready(function() {
	$("#treeTable").treeTable({expandLevel : 2});
});
</script>
</head>
<body>
	<ul class="nav nav-tabs" style="margin:0 4px;margin-bottom:4px;">
		<li class="active"><a href="${ctx}/systemMenu/list.do?type=1&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}">
		          <i class="icon icon-list"></i>&nbsp;<span>公路监管菜单列表</span></a></li>
		<sec:authorize ifAnyGranted="ROLE_sys_roadmenu_edit" > 
		<li><a href="${ctx}/systemMenu/input.do?type=1&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}">
		            <i class="icon icon-edit"></i>&nbsp;<span>菜单添加</span></a></li>
		</sec:authorize>         
	</ul>
	<div  class="form-horizontal container" style="width:auto" >
	<tags:message content="${msg}"/>
	<form id="listForm" method="post">
		<table id="treeTable" class="table table-striped table-bordered table-condensed">
			<tr>
				<th >名称</th>
				<th>链接</th>
				<th>ID</th>
				<th style="text-align:center;">排序</th>
				<th>可见</th>
				<th>权限标识</th>
				<th>标签</th>
				<th>备注</th>
				<th style="min-width:50px">操作</th>
			</tr>
			<c:set var="topMenuId" value="${topMenuId}"/>
			<c:forEach items="${list}" var="menu">
				<tr id="${menu.id}" pId="${menu.parent.id ne topMenuId?menu.parent.id:'0'}">
					<td><i class="icon icon-${not empty menu.icon?menu.icon:' hide'}"></i><a href="${ctx}/menu/sysmenu!input.action?top=${fns:encodeParam(param.top)}&left=${fns:encodeParam(param.left)}&id=${fns:encodeParam(menu.id)}">&nbsp;${menu.name}</a></td>
					<td>${fns:abbr(menu.href,50)}</td>
					<td>${menu.id}</td>
					<td style="text-align:center;">
							${menu.sort}
					</td>
					<td>${menu.isShow eq 1?'显示':'隐藏'}</td>
					<td>${menu.permission}</td>
					<td>${menu.tag}</td>
					<td>${menu.remark}</td>
					<td class="the_icons">
					<sec:authorize ifAnyGranted="ROLE_sys_roadmenu_edit" >
						<a href="${ctx}/systemMenu/input.do?type=1&id=${fns:encodeParam(menu.id)}&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}" title="修改"><i class="icon icon-edit"></i></a>
						<a href="${ctx}/systemMenu/delete.do?type=1&id=${fns:encodeParam(menu.id)}&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)" title="删除"><i class="icon icon-remove"></i></a>
						<a href="${ctx}/systemMenu/input.do?type=1&parentId=${fns:encodeParam(menu.id)}&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}" title="添加下级菜单"><i class="icon icon-tasks"></i></a>
					</sec:authorize> 
					</td>
				</tr>
			</c:forEach>
		</table>
		<div class="form-actions pagination-left hide">
			<input id="btnSubmit" class="btn btn-primary" type="button" value="保存排序" onclick="updateSort();"/>
		</div>
	 </form>
	 </div>
</body>
</html>